﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Smart
{
  public class DbBarkod : Tablo
  {
    public int recId { get; set; }
    public int StokId { get; set; }
    public string StokKodu { get; set; }
    public string Barkodu { get; set; }
    public byte Icerik { get; set; }
    public byte Tip { get; set; }
    public byte BirimNo { get; set; }

    public DbBarkod()
    {
      this.TabloAdi = "TBL_BARKOD";
    }

    public override IEnumerable<string> BulkImport(DateTime lastupdateDate)
    {
      yield return "İndiriliyor...";
      string[] dt = BackOffice.Get.BarkodList(lastupdateDate);
      yield return "indirildi.";
      foreach (string item in SqlCeClient.Get.importRows(this.TabloAdi, dt))
      {
        yield return item;
      }
      yield return "Tamamlandı";
    }
  }
}
